﻿@model ErrorModel
@{
    Layout = null;
}
<!DOCTYPE html>
<html lang="zh-cn">
<head>
    <meta charset="utf-8">
    <meta http-equiv="X-UA-Compatible" content="IE=edge">
    <meta name="viewport" content="width=device-width, initial-scale=1, shrink-to-fit=no">
    <link rel="apple-touch-icon" href="~/favicon.png" />
    <title>@ViewBag.Title</title>
    <link href="~/css/error.css" rel="stylesheet" asp-append-version="true" />
</head>
<body class="trans-mute">
    <section class="error-wrapper">
        <img src="@Url.Content(Model.Image)" />
        <h1>@Model.Content</h1>
        <h3>@Model.Detail</h3>
        <p><a href="@CoreConfiguration.DefaultLogin">登录</a> <span>或者</span> <a href="@Url.Content(Model.ReturnUrl)">返回首页</a> <span>或者</span> <a href="javascript:history.go(-1)">返回上一页</a></p>
        @if (Model.Id == 403)
        {
            <div>
                <p>也可能是以下原因导致您没有权限</p>
                <p>1. 没有登录，请登录后查看</p>
                <p>2. 当前用户未获得此资源的相应权限，请联系管理员</p>
            </div>
        }
    </section>
    <script src="~/js/jquery.min.js"></script>
    <script>
        $(function () {
            $.fn.extend({
                autoCenter: function () {
                    var that = this;
                    var getHeight = function () {
                        return Math.max(0, ($(window).height() - that.outerHeight()) / 2 + $(document).scrollTop());
                    };
                    $(window).resize(function () {
                        that.css({ marginTop: getHeight() });
                    });
                    that.css({ marginTop: getHeight(), transition: "all .5s linear" });
                }
            });
            $('.error-wrapper').autoCenter();
        });
    </script>
</body>
</html>